import { Component, OnInit } from '@angular/core';
import {Carousel} from "../model/Carousel";
import {CarouselService} from "../service/carousel.service";
import {ConfigService} from "../service/config.service";

@Component({
  selector: 'app-carouselforindex',
  templateUrl: './carouselforindex.component.html',
  styleUrls: ['./carouselforindex.component.css']
})
export class CarouselforindexComponent implements OnInit {

  cl:Array<Carousel>;

  constructor(private carouselservice:CarouselService
  ,private config:ConfigService
  ) {
    this.cl=new Array();
  }

  ngOnInit() {
  this.getCarouselList();

  }

  getCarouselList(){
    this.carouselservice.getCarouselList()
      .then((data:any)=>{

      this.cl=new Array();
      this.cl=data;

      })



  }

  onCarouselClick(url:string){

    window.open(url);
  }


}
